<?php
namespace app\index\controller;
use app\index\model\Common;
use Common\Model\admin;
use think\Console;
use think\Controller;
use think\Db;
use think\Model;
use think\Session;
use think\Cache;
class Index extends Base
{
    public function index()
    {
        $data = new Common();
        //获取lis动态统计
        //当天时间 各个平台的检验  审核  总统计
        //$liscount = $data->GetReportCountByRq(date('yy-m-d ',time()));
        /*(array_sort($liscount['sum'],'Count',SORT_DESC));*/
        //获取lis动态统计前一天
        //$liscount = $data->GetReportCountByRq(date("Y-m-d",strtotime("-1 day")));
        //获取正在生成的报告数量 并且缓存起来  五分钟
        if(extension_loaded('redis') && Cache::has('ReportCount')){
            $info['ReportCount'] = Cache::get('ReportCount');
        }else{
            $info['ReportCount'] = Model('Common')->getReportCreateNow();
            Cache::set('ReportCount', $info['ReportCount'],30);
        }
        /* $GetbusiYq = $data->GetReportCountAll('2020-05-27 00:00:00.000');*/
        /* var_dump(foreach as $GetbusiYq );
         exit();*/
        /*$count = $data->GetReportCountAll('2020-05-27 00:00:00.000');
        var_dump($count);exit();*/
        /*  //获取用户信息
          $info['user'] = Model('user')->getUserInfoByLogid($user)['username'];*///可以直接页面获取$Resuest.session.info.logid;*/
        //获取系统信息
        $info['os'] = PHP_OS;
        $info['date'] = gmdate("Y年n月j日 H:i:s", time() + 8 * 3600);
        //lis动态统计
        //$info['jcount'] = $liscount['j'];
        //$info['scount'] = $liscount['s'];
        $this->assign('info',$info);
        return view();
        /**
         *  生成页面静态化
         */
           /* $this->buildHtml('index',HTML_PATH,'Index/index');*/

    }
    //页面静态化
    public function build_html(){
        $this->index('buildHtml');
    }


}
